<!DOCTYPE html>
<%@ include file="/common/taglibs.jsp"%>
<html lang="en">
<head>
    <meta http-equiv="Cache-Control" content="no-store"/>
    <meta http-equiv="Pragma" content="no-cache"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" href="<c:url value="/images/favicon.ico"/>"/>
    <title><fmt:message key="userList.title"/> | <fmt:message key="webapp.name"/></title>

    <link rel="stylesheet" type="text/css" media="all" href="<c:url value='/styles/lib/bootstrap-2.2.1.min.css'/>" />
    <link rel="stylesheet" type="text/css" media="all" href="<c:url value='/styles/lib/bootstrap-responsive-2.2.1.min.css'/>" />
    <link rel="stylesheet" type="text/css" media="all" href="<c:url value='/styles/style.css'/>" />

    <script type="text/javascript" src="<c:url value='/scripts/lib/jquery-1.8.2.min.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/lib/bootstrap-2.2.1.min.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/lib/plugins/jquery.cookie.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/script.js'/>"></script>
</head>
<body id="userList">
    <!-- Header section -->
    <%@ include file="/common/header.jsp" %>

    <div class="container-fluid">
        <%@ include file="/common/messages.jsp" %>
        <div class="row-fluid">
            <c:if test="${not empty searchError}">
                <div class="alert alert-error fade in">
                    <a href="#" data-dismiss="alert" class="close">&times;</a>
                    <c:out value="${searchError}"/>
                </div>
            </c:if>

            <div class="span10">
                <h2><fmt:message key="userList.heading"/></h2>

                <form method="get" action="${ctx}/admin/users" id="searchForm" class="form-search">
                    <div id="search" class="input-append">
                        <input type="text" size="20" name="q" id="query" value="${param.q}"
                               placeholder="<fmt:message key="search.enterTerms"/>" class="input-medium search-query"/>
                        <button id="button.search" class="btn" type="submit">
                            <i class="icon-search"></i> <fmt:message key="button.search"/>
                        </button>
                    </div>
                </form>

                <div id="actions" class="form-actions">
                    <a class="btn btn-primary" href="<c:url value='/userform?method=Add&from=list'/>">
                        <i class="icon-plus icon-white"></i> <fmt:message key="button.add"/></a>

                    <a class="btn" href="<c:url value='/admin/main'/>">
                        <i class="icon-ok"></i> <fmt:message key="button.done"/></a>
                </div>

                <display:table name="userList" cellspacing="0" cellpadding="0" requestURI=""
                               defaultsort="1" id="users" pagesize="25" class="table table-condensed table-striped table-hover" export="true">
                    <display:column property="username" escapeXml="true" sortable="true" titleKey="user.username" style="width: 25%"
                                    url="/userform?from=list" paramId="id" paramProperty="id"/>
                    <display:column property="fullName" escapeXml="true" sortable="true" titleKey="activeUsers.fullName"
                                    style="width: 34%"/>
                    <display:column property="email" sortable="true" titleKey="user.email" style="width: 25%" autolink="true"
                                    media="html"/>
                    <display:column property="email" titleKey="user.email" media="csv xml excel pdf"/>
                    <display:column sortProperty="enabled" sortable="true" titleKey="user.enabled"
                                    style="width: 16%; padding-left: 15px" media="html">
                        <input type="checkbox" disabled="disabled" <c:if test="${users.enabled}">checked="checked"</c:if>/>
                    </display:column>
                    <display:column property="enabled" titleKey="user.enabled" media="csv xml excel pdf"/>

                    <display:setProperty name="paging.banner.item_name"><fmt:message key="userList.user"/></display:setProperty>
                    <display:setProperty name="paging.banner.items_name"><fmt:message key="userList.users"/></display:setProperty>

                    <display:setProperty name="export.excel.filename" value="User List.xls"/>
                    <display:setProperty name="export.csv.filename" value="User List.csv"/>
                    <display:setProperty name="export.pdf.filename" value="User List.pdf"/>
                </display:table>
            </div>
        </div>
    </div>

    <!-- Footer section -->
    <%@ include file="/common/footer.jsp" %>
</body>
</html>
